/*
 * @Author: your name
 * @Date: 2022-03-29 09:51:36
 * @LastEditTime: 2022-04-11 16:51:31
 * @LastEditors: chenyuanming
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \erp-management-system\src\components\container\Container.jsx
 */
import React from 'react';
import Page404 from '../../views/Page404/Page404';
// import {Route,Routes} from 'react-router-dom'
import { Layout } from 'antd';
import contractRouter from '../../router/contractRouter';
import afterSaleRouter from '../../router/afterSaleRouter';
import customerRouter from '../../router/customerRouter';
import customerHighSeasRouter from '../../router/customerHighSeasRouter';
import documentaryRouter from '../../router/documentaryRouter';
import employeeRouter from '../../router/employeeRouter';
import financeRouter from '../../router/financeRouter';
import goodsRouter from '../../router/goodsRouter';
import noticeRouter from '../../router/noticeRouter';
import orderRouter from '../../router/orderRouter';
import recycleBinRouter from '../../router/recycleBinRouter';
import workOrderRouter from '../../router/workOrderRouter';
import otherRouter from '../../router/otherRouter';
import addressListRouter  from '../../router/addressListRouter';
import announcementRouter  from '../../router/announcementRouter';
import Writereport from '../../views/other/WorkReport/Writing';
import Endorset from '../../views/other/WorkReport/Endorse';
import homeRouter from '../../router/homeRouter';
import Login from './../../views/login/Login';
import { useRoutes ,Navigate} from 'react-router-dom';

const { Content } = Layout;
const Container = () => {
    const routerMap = [
        ...homeRouter,
        ...contractRouter,
        ...contractRouter,
        ...afterSaleRouter,
        ...customerRouter,
        ...customerHighSeasRouter,
        ...documentaryRouter,
        ...employeeRouter,
        ...financeRouter,
        ...goodsRouter,
        ...noticeRouter,
        ...orderRouter,
        ...recycleBinRouter,
        ...workOrderRouter,
        ...otherRouter,
        ...addressListRouter,
        ...announcementRouter,
        {
            path: '/',
            element: <Navigate to="/home" />
        },
        {
            path:'*',
            element:<Page404/>
        },
    ]
    const element = useRoutes(routerMap)
    return (
        <Content
            className="site-layout-background"
            style={{
                margin: '10px',
                padding: '10px',
                minHeight: '280',
                overflow: 'auto',
                height: '84vh',
            }}
        >
            {element}
        </Content>
    );
}

export default Container;
